package Generic.pair3;

import Generic.Pairs;

class PairAlg {
    public static boolean hasNulls(Pairs<?> pairs){
        return pairs.getFirst()==null || pairs.getSecond()==null;
    }

    public static void swap(Pairs<?> pairs){swapHelper(pairs);}

    public static <T> void swapHelper(Pairs<T> pairs) {
        T t=pairs.getFirst();
        pairs.setFirst(pairs.getSecond());
        pairs.setSecond(t);
    }
}
